package com.tac.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tac.common.result.Result;
import com.tac.dao.DataAcquisitionDao;
import com.tac.pojo.DataAcquisition;
import com.tac.service.DataAcquisitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DataAcquisitionServiceImpl implements DataAcquisitionService {

    @Autowired
    private DataAcquisitionDao dataAcquisitionDao;


    //查看能耗数据采集列表
    public Result<PageInfo<DataAcquisition>> getList(Integer pageNum, Integer pageSize, String deviceName){
        PageHelper.startPage(pageNum,pageSize);
        List<DataAcquisition> list = dataAcquisitionDao.getList(deviceName);
        PageInfo<DataAcquisition> dataAcquisitionPageInfo = new PageInfo<>(list);
        return Result.success(dataAcquisitionPageInfo);
    }
}
